@import "./variables";
html {
  font-size: 13px;
}

.bs {
  box-sizing: border-box;
}

// set color
@each $key, $color in $colors {
  .text-#{$key} {
    color: $color;
  }
  .bg-#{$key} {
    background-color: $color;
  }
}

// text align
@each $var in (left, center, right) {
  .text-#{$var} {
    text-align: $var;
  }
}

// font size
@each $key, $size in $font-sizes {
  .fs-#{$key} {
    font-size: $size * $base-font-size;
  }
}

// flex
.d-flex {
  display: flex;
}

@each $key, $value in $flex-jc {
  .jc-#{$key} {
    justify-content: $value;
  }
}

@each $key, $value in $flex-ai {
  .ai-#{$key} {
    align-items: $value;
  }
}

.flex-column {
  flex-direction: column;
}

.flex-1 {
  flex: 1;
}

@each $typeKey, $type in $spacing-types {
  // .m-1
  @each $sizeKey, $size in $spacing-sizes {
    .#{$typeKey}-#{$sizeKey} {
      #{$type}: $size * $spacing-base-sizes;
    }
  }

  // .mx-1, .my-1
  @each $sizeKey, $size in $spacing-sizes {
    .#{$typeKey}x-#{$sizeKey} {
      #{$type}-left: $size * $spacing-base-sizes;
      #{$type}-right: $size * $spacing-base-sizes;
    }
    .#{$typeKey}y-#{$sizeKey} {
      #{$type}-top: $size * $spacing-base-sizes;
      #{$type}-bottom: $size * $spacing-base-sizes;
    }
  }

  // .mt-1
  @each $directionKey, $direction in $spacing-directions {
    @each $sizeKey, $size in $spacing-sizes {
      .#{$typeKey}#{$directionKey}-#{$sizeKey} {
        #{$type}-#{$direction}: $size * $spacing-base-sizes;
      }
    }
  }
}

// 导航栏
.nav {
  h2 {
    border-bottom: 3px solid transparent;
    &.active {
      border-bottom: 3px solid #fff;
    }
  }
}

.w-100 {
  width: 100%;
}

.h-100 {
  height: 100%;
}

.text-ellipsis {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.f-wrap{
  flex-wrap: wrap;
}

// h5端隐藏滚动条
/deep/::-webkit-scrollbar {
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
}

// 不换行
.no-wrap{
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
// 限制行数
.clamp2{
  overflow:hidden;
  text-overflow:ellipsis;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
}

// 主要按钮
.main-button{
	width: 100%;
	margin: 20upx 0;
	font-size: 38upx;
	color: #333333;
	background-color: #FFE933;
}

// 居中
.z-center{
	text-align: center;
	margin: 0 auto;
}
